package com.jf.thread;

public class TicketWindow extends Thread{

    private int ticket = 100;

    @Override
    public void run() {
        while (ticket > 0){
            try {
                sleep(100);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            ticket--;
            System.out.println(Thread.currentThread().getName()+"销售1张，剩余:"+ticket);
        }
    }
}
